<md-dialog aria-label="新建模板" flex="">
  <form>

    <md-toolbar>
      <div class="md-toolbar-tools" layout="row"  layout-align="center center">
        <h2>新建模板</h2>
      </div>
    </md-toolbar>

    <md-dialog-content style="">
      <md-tabs md-dynamic-height md-border-bottom md-selected="step"  md-autoselect>
        <md-tab label="输入模板名称">
          <md-content class="md-padding">
            <h1 class="md-display-2">输入模板名称</h1>
            <p>

              <ng-form >
                <div class="form-group">
                  <label for="template-name" class="control-label" ng-show="!shareData.sonTemplate"></label>
                  <input type="text" name="template-name" ng-model="templatename" class="form-control"></div>
                <div class="upload-hint ng-binding upload-success" ng-class="{true:'upload-success', false:'upload-fail'}[isOkName]" ng-show="!isOkName">
                  <span class="glyphicon glyphicon-ok" ng-class="{true:'glyphicon-ok', false:'glyphicon-remove'}[isOkName]"></span>
                  名称不可用！
                </div>
                <button class="btn btn-default" ng-disabled="!isOkName" ng-click="toUploadFile()">next</button>
              </ng-form>

            </p>
          </md-content>
        </md-tab>
        <md-tab label="上传文件" ng-disabled="!step">
        <!-- <md-tab label="上传文件" ng-disabled="!step"> -->
          <md-content class="md-padding" layout="column"  layout-align="">
            <h1 class="md-display-2" >上传文件</h1>
              <upload-file file-name="fileName" real-file-name="realFileName"></upload-file>


          </md-content>
        </md-tab>
        <md-tab label="添加主规则" ng-disabled="!isUploaded">
          <md-progress-circular md-mode="indeterminate" ng-show="waitResult"></md-progress-circular>
        <!-- <md-tab label="添加主规则" ng-disabled="!isUploaded"> -->
          <md-content class="md-padding">
            <h1 class="md-display-2">添加主规则</h1>
            <div layout="row" layout-align="space-around">
              <!-- <new-rule test-type="file" real-file-name="realFileName" file-name="fileName" saved-rule="savedRule" article-list="articleList"></new-rule> -->
              <div>
                <add-rule rule-obj="ruleObj" test-rule="test()" name-read-only="true"></add-rule>
              </div>
              <div>
                <!-- <test-text></test-text> -->
                <pre><h5>测试结果</h5><br /><label>{{testResult.info}}</label><ul><li ng-repeat="result in testResult.data"><label>第{{$index+1}}条记录</label><br />{{result.text}}</li></ul></pre>
              </div>
            </div>
          </md-content>
        </md-tab>
      </md-tabs>
    </md-dialog-content>

    <md-dialog-actions layout="row"  layout-align="center center" >
      <md-button class="md-raised" ng-click="cancel()" ng-disabled="isMainRule">
        取消
      </md-button>
      <md-button class="md-raised" ng-click="hide()" ng-disabled="!canBeSaved||!ruleObj.name">
        确定
      </md-button>
    </md-dialog-actions>

  </form>
</md-dialog>
